﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe Name="CreateSetupProject" xmlns="http://schemas.microsoft.com/pag/gax-core"
                               xmlns:xi="http://www.w3.org/2001/XInclude" Bound="true">
  <xi:include href="../Common/CommonTypeAliases.xml"
				xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Types)" />
  <Caption>Create a new VS Package setup</Caption>
  <Description>Create a new VS Package setup</Description>
  <Arguments>
    <xi:include href="../Common/CommonArguments.xml"
					  xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Arguments/gax:Argument)" />
    <Argument Name="safeprojectname"/>
    <Argument Name="VSPackageProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true"/>
    <Argument Name="VSPackageProjectName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(VSPackageProject.Name)"
                     Stage="OnBeginRecipe">
      </ValueProvider>
    </Argument>
    <Argument Name="VSPackageAssemblyName" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="$(VSPackageProject.Properties.Item('AssemblyName').Value.ToString())"
                     Stage="OnBeginRecipe">
      </ValueProvider>
    </Argument>    
    <Argument Name="SetupProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider
        Type="VSSDKAssist.Assets.ValueProviders.VisualStudio.ProjectByPathExpressionProvider, VSSDKAssist.Assets"
        PathExpression="$(safeprojectname)"
        Stage="OnBeforeActions"/>
    </Argument>
    <Argument Name="FilesTT" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="TT\common\CreateSetupProject\Files.tt"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="MainTT" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="TT\common\CreateSetupProject\Main.tt"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="PackageRegistryTT" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="TT\common\CreateSetupProject\PackageRegistry.tt"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="RegistryTT" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="TT\common\CreateSetupProject\Registry.tt"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="StringsTT" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="TT\common\CreateSetupProject\Strings.tt"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="Manufacturer" Required="true"/>
    <Argument Name="ProductNameArgument" Required="true"/>
    <Argument Name="Description" Required="true"/>
    <Argument Name="Comments" Required="true"/>
    <Argument Name="RegistrationMethod" Type="Microsoft.VisualStudio.Shell.RegistrationMethod, Microsoft.VisualStudio.Shell.9.0, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider Type="VSSDKAssist.Recipes.Common.ValueProviders.DefaultRegistrationMethodValueProvider, VSSDKAssist"
               Stage="OnBeginRecipe"/>
    </Argument>
  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page Type="VSSDKAssist.Recipes.CreateSetupProject.CreateSetupProjectCP, VSSDKAssist"
            Height="200" Width="510">
          <Title>Specify setup properties</Title>
          <LinkTitle>Setup properties</LinkTitle>
        </Page>
        <!--<Page
              Height="200" Width="510">
          <Title>Specify VS Package Setup properties</Title>
          <LinkTitle>VS Package Setup properties</LinkTitle>
          <Fields>
            <Field ValueName="VSPackageProject" Label="VS Package project">
              <Editor Type="Microsoft.Practices.RecipeFramework.Library.Editors.SolutionPickerEditor, Microsoft.Practices.RecipeFramework.Library" />
            </Field>
            <Field ValueName="RegistrationMethod" Label="Registration method" />
            <Field ValueName="Manufacturer" Label="Manufacturer" />
            <Field ValueName="ProductNameArgument" Label="Product name" />
            <Field ValueName="Description" Label="Description" />
            <Field ValueName="Comments" Label="Comments" />
          </Fields>
        </Page>-->
      </Pages>
    </Wizard>
  </GatheringServiceData>
  <Actions CoordinatorServiceType="VSSDKAssist.Recipes.Common.Coordinators.ExecutionProgressCoordinator, VSSDKAssist">
    <!--Compile project-->
    <Action Name="CompileProject"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.CompileProjectAction, VSSDKAssist.Assets"
          StatusMessage="Compiling project"
          WriteMessageToOutputWindow="true">
      <Input Name="Project" RecipeArgument="VSPackageProject"/>
    </Action>
    <!-- Add wxs fragments-->
    <Action Name="GenerateFilesWxs"
            Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
            StatusMessage="Creating wix fragments"
            WriteMessageToOutputWindow="true">
      <Input Name="Template" RecipeArgument="FilesTT"/>
      <Input Name="VSPackageProjectName" RecipeArgument="VSPackageProjectName"/>
      <Input Name="VSPackageAssemblyName" RecipeArgument="VSPackageAssemblyName"/>      
      <Output Name="Content" />
    </Action>
    <Action Name="AddFilesWxs"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringAction, VSSDKAssist.Assets"
            TargetFileName="Files.wxs"
            Open="false">
      <Input Name="Project" RecipeArgument="SetupProject"/>
      <Input Name="Content" ActionOutput="GenerateFilesWxs.Content"/>
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction1"
        Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
        BuildAction="prjBuildActionCompile">
      <Input Name="ProjectItem" ActionOutput="AddFilesWxs.ProjectItem"/>
    </Action>
    <Action Name="GenerateMainWxs"
        Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library">
      <Input Name="Template" RecipeArgument="MainTT"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddMainWxs"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringAction, VSSDKAssist.Assets"
            TargetFileName="Main.wxs"
            Open="false">
      <Input Name="Project" RecipeArgument="SetupProject"/>
      <Input Name="Content" ActionOutput="GenerateMainWxs.Content"/>
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction2"
        Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
        BuildAction="prjBuildActionCompile">
      <Input Name="ProjectItem" ActionOutput="AddMainWxs.ProjectItem"/>
    </Action>
    <Action Name="GeneratePackageRegistryWxs"
          Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library">
      <Input Name="Template" RecipeArgument="PackageRegistryTT"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddPackageRegistryWxs"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringAction, VSSDKAssist.Assets"
            TargetFileName="PackageRegistry.wxs"
            Open="false">
      <Input Name="Project" RecipeArgument="SetupProject"/>
      <Input Name="Content" ActionOutput="GeneratePackageRegistryWxs.Content"/>
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction3"
        Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
        BuildAction="prjBuildActionCompile">
      <Input Name="ProjectItem" ActionOutput="AddPackageRegistryWxs.ProjectItem"/>
    </Action>
    <Action Name="GenerateRegistryWxs"
        Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library">
      <Input Name="Template" RecipeArgument="RegistryTT"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddRegistryWxs"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringAction, VSSDKAssist.Assets"
            TargetFileName="Registry.wxs"
            Open="false">
      <Input Name="Project" RecipeArgument="SetupProject"/>
      <Input Name="Content" ActionOutput="GenerateRegistryWxs.Content"/>
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction4"
        Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
        BuildAction="prjBuildActionCompile">
      <Input Name="ProjectItem" ActionOutput="AddRegistryWxs.ProjectItem"/>
    </Action>
    <Action Name="GenerateStringsWxl"
        Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library">
      <Input Name="Template" RecipeArgument="StringsTT"/>
      <Input Name="Manufacturer" RecipeArgument="Manufacturer"/>
      <Input Name="ProductName" RecipeArgument="ProductNameArgument"/>
      <Input Name="Description" RecipeArgument="Description"/>
      <Input Name="Comments" RecipeArgument="Comments"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddStringsWxl"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringAction, VSSDKAssist.Assets"
            TargetFileName="Strings.wxl"
            Open="false">
      <Input Name="Project" RecipeArgument="SetupProject"/>
      <Input Name="Content" ActionOutput="GenerateStringsWxl.Content"/>
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction5"
        Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
        BuildAction="prjBuildActionContent">
      <Input Name="ProjectItem" ActionOutput="AddStringsWxl.ProjectItem"/>
    </Action>
    <Action Name="GeneratePackageRegistryWxi"
            Type="VSSDKAssist.Recipes.Common.Actions.CreatePackageRegistryFragment, VSSDKAssist">
      <Input Name="Project" RecipeArgument="VSPackageProject"/>
      <Input Name="RegistrationMethod" RecipeArgument="RegistrationMethod"/>
      <Output Name="FragmentContent"/>
    </Action>    
    <Action Name="AddPackageRegistryWxi"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringAction, VSSDKAssist.Assets"
            TargetFileName="PackageRegistry.wxi"
            Open="false">
      <Input Name="Project" RecipeArgument="SetupProject"/>
      <Input Name="Content" ActionOutput="GeneratePackageRegistryWxi.FragmentContent"/>
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction6"
      Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
      BuildAction="prjBuildActionContent">
      <Input Name="ProjectItem" ActionOutput="AddPackageRegistryWxi.ProjectItem"/>
    </Action>
    <Action Name="AddReferenceToSetupProject" Type="VSSDKAssist.Assets.Actions.VisualStudio.VisualStudio.AddProjectReferenceAction ,VSSDKAssist.Assets">
      <Input Name="ReferringProject" RecipeArgument="SetupProject"/>
      <Input Name="ReferencedProject" RecipeArgument="VSPackageProject"/>
    </Action>
  </Actions>
</Recipe>